home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / glibmm-2.4 / glibmm / pattern.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-20  |  1.8 KB  |  70 lines

  1. // -*- c++ -*-
  2. #ifndef _GLIBMM_PATTERN_H
  3. #define _GLIBMM_PATTERN_H
  4.  
  5. /* $Id: pattern.h,v 1.1.1.1 2003/01/07 16:58:51 murrayc Exp $ */
  6.  
  7. /* pattern.h
  8.  *
  9.  * Copyright (C) 2002 The gtkmm Development Team
  10.  *
  11.  * This library is free software; you can redistribute it and/or
  12.  * modify it under the terms of the GNU Library General Public
  13.  * License as published by the Free Software Foundation; either
  14.  * version 2 of the License, or (at your option) any later version.
  15.  *
  16.  * This library is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  19.  * Library General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU Library General Public
  22.  * License along with this library; if not, write to the Free
  23.  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  */
  25.  
  26. extern "C" { typedef struct _GPatternSpec GPatternSpec; }
  27.  
  28. #include <glibmm/ustring.h>
  29.  
  30.  
  31. namespace Glib
  32. {
  33.  
  34. /** @defgroup PatternMatching Glob-style Pattern Matching
  35.  * Match strings against patterns containing '*' (wildcard) and '?' (joker).
  36.  * @{
  37.  */
  38.  
  39. class PatternSpec
  40. {
  41. public:
  42.   explicit PatternSpec(const Glib::ustring& pattern);
  43.   explicit PatternSpec(GPatternSpec* gobject);
  44.   ~PatternSpec();
  45.  
  46.   bool match(const Glib::ustring& str) const;
  47.   bool match(const Glib::ustring& str, const Glib::ustring& str_reversed) const;
  48.  
  49.   bool operator==(const PatternSpec& rhs) const;
  50.   bool operator!=(const PatternSpec& rhs) const;
  51.  
  52.   GPatternSpec*       gobj()       { return gobject_; }
  53.   const GPatternSpec* gobj() const { return gobject_; }
  54.  
  55. private:
  56.   GPatternSpec* gobject_;
  57.  
  58.   // noncopyable
  59.   PatternSpec(const PatternSpec&);
  60.   PatternSpec& operator=(const PatternSpec&);
  61. };
  62.  
  63. /** @} group PatternMatching */
  64.  
  65. } // namespace Glib
  66.  
  67.  
  68. #endif /* _GLIBMM_PATTERN_H */
  69.  
  70.